#include <stdio.h>

//奇数在前半部分，偶数在后半部分

void ParSort(int *arr, int n) {
    int left = 0;
    int right = n - 1;
    for (; left < right; left++, right--) {
        while (arr[left] % 2 != 0) {
            left++;
        }
        while (arr[right] % 2 == 0) {
            right--;
        }
        if (arr[left] % 2 == 0 && arr[right] % 2 != 0 && left < right) {
            arr[right] = arr[left] ^ arr[right];
            arr[left] = arr[left] ^ arr[right];
            arr[right] = arr[left] ^ arr[right];
        }
    }
}

int main() {
    int arr[7] = {2, 4, 4, 5, 5,7,0};
    ParSort(arr, 7);
    for (int i = 0; i < 7; i++) {
        printf("%d", arr[i]);
    }
    return 0;
}